package de.dubiel.plung.client.canvas;

import com.google.gwt.canvas.dom.client.Context2d;

/**
 * Hilfsmittel zum Zeichnen eines Rechtecks.
 * 
 * @author alike
 * 
 */
public class Rectangle implements Drawable {

    private int strokeWidth;
    private String fillColor;
    private String strokeColor;
    private Vector topLeft;
    private int width;
    private int height;

    @Override
    public void draw(Context2d context) {
        context.setLineWidth(strokeWidth);
        context.setStrokeStyle(strokeColor);
        context.setFillStyle(fillColor);
        context.fillRect(topLeft.getX(), topLeft.getY(), width, height);
        context.fill();
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getStrokeWidth() {
        return strokeWidth;
    }

    public void setStrokeWidth(int strokeWidth) {
        this.strokeWidth = strokeWidth;
    }

    public String getStrokeColor() {
        return strokeColor;
    }

    public void setStrokeColor(String strokeColor) {
        this.strokeColor = strokeColor;
    }

    public String getFillColor() {
        return fillColor;
    }

    public void setFillColor(String fillColor) {
        this.fillColor = fillColor;
    }

    public Vector getTopLeft() {
        return topLeft;
    }

    public void setTopLeft(Vector topLeft) {
        this.topLeft = topLeft;
    }
}